package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.WishMapper;
import com.jsb.model.Wish;
import com.jsb.model.WishExample;

@Service
public class WishService{
	
	@Resource
	private WishMapper wishMapper;
	
	public void addWish(Wish wish) {
		wishMapper.insertSelective(wish);
	}
	
	public void delWishById(String id) {
		wishMapper.deleteByPrimaryKey(id);
	}
	
	public void updateWish(Wish wish) {
		wishMapper.updateByPrimaryKeySelective(wish);
	}
	
	public void updateWishByExample(Wish wish,WishExample wishExample){
	    wishMapper.updateByExampleSelective(wish,wishExample);
	}
	
	public Wish getWishById(String id) {
		return wishMapper.selectByPrimaryKey(id);
	}
	
	public List<Wish> getPageWish(WishExample wishExample) {
		return wishMapper.selectPage(wishExample);
	}
	
	public int countWish(WishExample wishExample) {
		return wishMapper.countByExample(wishExample);
	}
	
	public List<Wish> selectByExample(WishExample example){
	    return wishMapper.selectByExample(example);
	}
}
